package jef.database.routing.jdbc;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

import jef.database.jdbc.GenerateKeyReturnOper;

public interface SQLExecutor {
	public void setFetchSize(int fetchSize);
	public void setMaxResults(int maxRows);
	public void setQueryTimeout(int queryTimeout);
	/**
	 * 执行查询
	 * @param resultType
	 * @param resultConcurrency
	 * @param resultHoldability
	 * @param params
	 * @return
	 * @throws SQLException
	 */
	public ResultSet getResultSet(int resultType,int resultConcurrency,int resultHoldability,List<ParameterContext> params) throws SQLException;
	/**
	 * 执行Update Delete Insert等操作
	 * @param generateKeys
	 * @param returnIndex
	 * @param returnColumns
	 * @param params
	 * @return
	 * @throws SQLException
	 */
	public UpdateReturn executeUpdate(GenerateKeyReturnOper generateKeys,List<ParameterContext> params) throws SQLException;
	/**
	 * 执行Batch操作
	 * @param autoGeneratedKeys
	 * @param columnIndexes
	 * @param columnNames
	 * @param params
	 * @return
	 * @throws SQLException
	 */
	public BatchReturn executeBatch(GenerateKeyReturnOper generateKeys, List<List<ParameterContext>> params) throws SQLException;
}
